home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 60.zip / BS1 part 60 / Highspeed pascal.adf / Interface / Expansion.pas < prev    next >
Pascal/Delphi Source File  |  1992-01-16  |  5KB  |  225 lines

  1. Unit Expansion;
  2.  
  3. Interface
  4. Uses AmigaDOS, Exec;
  5.  
  6. Type
  7.   pConfigDev = ^tConfigDev;
  8.   tCurrentBinding = Record
  9.           cb_ConfigDev: pConfigDev;
  10.           cb_FileName: pShortInt;
  11.           cb_ProductString: pShortInt;
  12.           cb_ToolTypes: ppShortInt;
  13.         End;
  14.  
  15.   tExpansionBase = Record
  16.           LibNode: tLibrary;
  17.           Flags: ShortInt;
  18.           pad: ShortInt;
  19.           ExecBase: Pointer;
  20.           SegList: Pointer;
  21.           CurrentBinding: tCurrentBinding;
  22.           BoardList: tList;
  23.           MountList: tList;
  24.           AllocTable: Array [0..255] of ShortInt;
  25.           BindSemaphore: tSignalSemaphore;
  26.           Int2List: tInterrupt;
  27.           Int6List: tInterrupt;
  28.           Int7List: tInterrupt;
  29.         End;
  30.  
  31.   tExpansionInt = Record
  32.           IntMask: Integer;
  33.           ArrayMax: Integer;
  34.           ArraySize: Integer;
  35.         End;
  36.  
  37.   tExpansionRom = Record
  38.           er_Type: ShortInt;
  39.           er_Product: ShortInt;
  40.           er_Flags: ShortInt;
  41.           er_Reserved03: ShortInt;
  42.           er_Manufacturer: Integer;
  43.           er_SerialNumber: LongInt;
  44.           er_InitDiagVec: Integer;
  45.           er_Reserved0c: ShortInt;
  46.           er_Reserved0d: ShortInt;
  47.           er_Reserved0e: ShortInt;
  48.           er_Reserved0f: ShortInt;
  49.         End;
  50.  
  51.   tDiagArea = Record
  52.           da_Config: ShortInt;
  53.           da_Flags: ShortInt;
  54.           da_Size: Integer;
  55.           da_DiagPoint: Integer;
  56.           da_BootPoint: Integer;
  57.           da_Name: Integer;
  58.           da_Reserved01: Integer;
  59.           da_Reserved02: Integer;
  60.         End;
  61.  
  62.   tExpansionControl = Record
  63.           ec_Interrupt: ShortInt;
  64.           ec_Reserved11: ShortInt;
  65.           ec_BaseAddress: ShortInt;
  66.           ec_Shutup: ShortInt;
  67.           ec_Reserved14: ShortInt;
  68.           ec_Reserved15: ShortInt;
  69.           ec_Reserved16: ShortInt;
  70.           ec_Reserved17: ShortInt;
  71.           ec_Reserved18: ShortInt;
  72.           ec_Reserved19: ShortInt;
  73.           ec_Reserved1a: ShortInt;
  74.           ec_Reserved1b: ShortInt;
  75.           ec_Reserved1c: ShortInt;
  76.           ec_Reserved1d: ShortInt;
  77.           ec_Reserved1e: ShortInt;
  78.           ec_Reserved1f: ShortInt;
  79.         End;
  80.  
  81.   tConfigDev = Record
  82.           cd_Node: tNode;
  83.           cd_Flags: ShortInt;
  84.           cd_Pad: ShortInt;
  85.           cd_Rom: tExpansionRom;
  86.           cd_BoardAddr: Pointer;
  87.           cd_BoardSize: Pointer;
  88.           cd_SlotAddr: Integer;
  89.           cd_SlotSize: Integer;
  90.           cd_Driver: Pointer;
  91.           cd_NextCD: pConfigDev;
  92.           cd_Unused: Array [0..3] of LongInt;
  93.         End;
  94.  
  95.   pCurrentBinding = ^tCurrentBinding;
  96.   pExpansionBase = ^tExpansionBase;
  97.   pDeviceNode = ^tDeviceNode;
  98.  
  99.  
  100. Var
  101.   ExpansionBase: pExpansionBase;
  102.  
  103.  
  104. Const
  105.   ECIF_INTERRUPTING = $80;
  106.   DAC_BUSWIDTH = $C0;
  107.   ECIB_INTENA = $1;
  108.   DAC_NIBBLEWIDE = $0;
  109.   E_MEMORYBASE = $200000;
  110.   ERTB_CHAINEDCONFIG = $3;
  111.   ECIF_INTENA = $2;
  112.   ERT_NEWBOARD = $C0;
  113.   ERTF_CHAINEDCONFIG = $8;
  114.   ERFB_NOSHUTUP = $6;
  115.   ERFF_NOSHUTUP = $40;
  116.   ERTB_MEMLIST = $5;
  117.   DAC_CONFIGTIME = $10;
  118.   E_EXPANSIONBASE = $E80000;
  119.   ERTF_MEMLIST = $20;
  120.   ERTB_DIAGVALID = $4;
  121.   E_MEMORYSLOTS = $80;
  122.   ERTF_DIAGVALID = $10;
  123.   ECIB_INT2PEND = $4;
  124.   E_MEMORYSIZE = $800000;
  125.   ERT_TYPEMASK = $C0;
  126.   ERT_MEMMASK = $7;
  127.   ECIB_INT6PEND = $5;
  128.   ECIF_INT2PEND = $10;
  129.   ECIB_INT7PEND = $6;
  130.   ECIF_INT6PEND = $20;
  131.   E_EXPANSIONSLOTS = $8;
  132.   ECIB_RESET = $3;
  133.   ECIF_INT7PEND = $40;
  134.   ECIF_RESET = $8;
  135.   ERT_TYPESIZE = $2;
  136.   E_SLOTSHIFT = $10;
  137.   ERT_MEMSIZE = $3;
  138.   ERFB_MEMSPACE = $7;
  139.   E_EXPANSIONSIZE = $80000;
  140.   ERFF_MEMSPACE = $80;
  141.   ERT_TYPEBIT = $6;
  142.   ADNB_STARTPROC = $0;
  143.   ERT_MEMBIT = $0;
  144.   ADNF_STARTPROC = $1;
  145.   CDB_CONFIGME = $1;
  146.   EXPANSIONNAME = 'expansion.library';
  147.   DAC_NEVER = $0;
  148.   DAC_BINDTIME = $20;
  149.   CDF_CONFIGME = $2;
  150.   CDB_SHUTUP = $0;
  151.   E_SLOTMASK = $FFFF;
  152.   CDF_SHUTUP = $1;
  153.   TOTALSLOTS = $100;
  154.   DAC_BYTEWIDE = $40;
  155.   E_SLOTSIZE = $10000;
  156.   ECIB_INTERRUPTING = $7;
  157.   DAC_BOOTTIME = $30;
  158.   DAC_WORDWIDE = $80;
  159.  
  160.  
  161. Procedure AddConfigDev (configDev: pConfigDev);
  162. Procedure AllocBoardMem (slotSpec: LongInt);
  163. Function AllocConfigDev: pConfigDev;
  164. Function AllocExpansionMem
  165.          (numSlots: LongInt;
  166.           SlotAlign: LongInt): Pointer;
  167.  
  168. Procedure ConfigBoard
  169.          (board: Pointer;
  170.           configDev: pConfigDev);
  171.  
  172. Procedure ConfigChain (baseAddr: Pointer);
  173. Function FindConfigDev
  174.          (oldConfigDev: pConfigDev;
  175.           manufacturer: LongInt;
  176.           product: LongInt): pConfigDev;
  177.  
  178. Procedure FreeBoardMem
  179.          (startSlot: LongInt;
  180.           slotSpec: LongInt);
  181.  
  182. Procedure FreeConfigDev (configDev: pConfigDev);
  183. Procedure FreeExpansionMem
  184.          (startSlot: LongInt;
  185.           numSlots: LongInt);
  186.  
  187. Function ReadExpansionByte
  188.          (board: Pointer;
  189.           offset: LongInt): ShortInt;
  190.  
  191. Procedure ReadExpansionRom
  192.          (board: Pointer;
  193.           configDev: pConfigDev);
  194.  
  195. Procedure RemConfigDev (configDev: pConfigDev);
  196. Procedure WriteExpansionByte
  197.          (board: Pointer;
  198.           offset: LongInt;
  199.           byte: LongInt);
  200.  
  201. Procedure ObtainConfigBinding;
  202. Procedure ReleaseConfigBinding;
  203. Procedure SetCurrentBinding
  204.          (currentBinding: pCurrentBinding;
  205.           bindingSize: LongInt);
  206.  
  207. Function GetCurrentBinding
  208.          (currentBinding: pCurrentBinding;
  209.           bindingSize: LongInt): LongInt;
  210.  
  211. Function MakeDosNode (parmPacket: Pointer): pDeviceNode;
  212. Function AddDosNode
  213.          (bootPri: ShortInt;
  214.           flags: LongInt;
  215.           dosNode: pDeviceNode): Boolean;
  216.  
  217.  
  218.  
  219. Function ERT_MEMNEEDED (t: ShortInt): LongInt;
  220. Function ERT_SLOTSNEEDED (t: ShortInt): ShortInt;
  221. Function EC_MEMADDR (slot: Integer): APTR;
  222.  
  223.  
  224. End.
  225.